package gui;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ServerGui extends JFrame
{
	private JTextField textField;
	private JButton btnShutdown;
	public ServerGui(String ip) 
	{
		getContentPane().setLayout(null);
		
		JLabel lblNewLabel = new JLabel("Server");
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblNewLabel.setBounds(175, 37, 205, 28);
		getContentPane().add(lblNewLabel);
		
		JLabel lblMyIp = new JLabel("My IP:");
		lblMyIp.setBounds(39, 126, 46, 14);
		getContentPane().add(lblMyIp);
		
		textField = new JTextField();
		textField.setEditable(false);
		textField.setBounds(119, 123, 184, 20);
		getContentPane().add(textField);
		textField.setColumns(10);
		
		this.textField.setText(ip);
		
		btnShutdown = new JButton("Shutdown");
		btnShutdown.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				System.exit(0);
			}
		});
		btnShutdown.setBounds(156, 189, 128, 23);
		getContentPane().add(btnShutdown);
	}
}
